/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Felipe Duarte
 */
@Entity
@Table(name = "barrio_construccion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BarrioConstruccion.findAll", query = "SELECT b FROM BarrioConstruccion b"),
    @NamedQuery(name = "BarrioConstruccion.findByIdBarrioConstruccion", query = "SELECT b FROM BarrioConstruccion b WHERE b.idBarrioConstruccion = :idBarrioConstruccion")})
public class BarrioConstruccion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_BARRIO_CONSTRUCCION")
    private Integer idBarrioConstruccion;
    @JoinColumn(name = "ID_CONSTRUCCION_BARRIO_CONSTRUCCION", referencedColumnName = "ID_CONSTRUCCION")
    @ManyToOne(optional = false)
    private Construccion idConstruccionBarrioConstruccion;
    @JoinColumn(name = "ID_BARRIO_BARRIO_CONSTRUCCION", referencedColumnName = "ID_BARRIO")
    @ManyToOne(optional = false)
    private Barrio idBarrioBarrioConstruccion;

    public BarrioConstruccion() {
    }

    public BarrioConstruccion(Integer idBarrioConstruccion) {
        this.idBarrioConstruccion = idBarrioConstruccion;
    }

    public Integer getIdBarrioConstruccion() {
        return idBarrioConstruccion;
    }

    public void setIdBarrioConstruccion(Integer idBarrioConstruccion) {
        this.idBarrioConstruccion = idBarrioConstruccion;
    }

    public Construccion getIdConstruccionBarrioConstruccion() {
        return idConstruccionBarrioConstruccion;
    }

    public void setIdConstruccionBarrioConstruccion(Construccion idConstruccionBarrioConstruccion) {
        this.idConstruccionBarrioConstruccion = idConstruccionBarrioConstruccion;
    }

    public Barrio getIdBarrioBarrioConstruccion() {
        return idBarrioBarrioConstruccion;
    }

    public void setIdBarrioBarrioConstruccion(Barrio idBarrioBarrioConstruccion) {
        this.idBarrioBarrioConstruccion = idBarrioBarrioConstruccion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBarrioConstruccion != null ? idBarrioConstruccion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BarrioConstruccion)) {
            return false;
        }
        BarrioConstruccion other = (BarrioConstruccion) object;
        if ((this.idBarrioConstruccion == null && other.idBarrioConstruccion != null) || (this.idBarrioConstruccion != null && !this.idBarrioConstruccion.equals(other.idBarrioConstruccion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.BarrioConstruccion[ idBarrioConstruccion=" + idBarrioConstruccion + " ]";
    }
    
}
